﻿namespace com.stifel.ProjectMgmt
{
    using System;

    using com.stifel.Extensions.StringExtensions;

    public class internalProject
    {
        #region Fields

        const string MMMDYY = "MMM d, yyyy";
        const string NA = "n/a";

        string _ToolTip;

        #endregion Fields

        #region Constructors

        public internalProject( )
        {
        }

        public internalProject( DateTime? startDate, DateTime? dueDate, string group, string teamName, string title, string projectDescription, ColorScheme groupColor, ColorScheme projectColor )
        {
            DueDate = dueDate;
            StartDate = startDate;
            Group = group;
            TeamName = teamName;
            Title = title;
            ProjectDescription = projectDescription;
            GroupColor = groupColor;
            ProjectColor = projectColor;
        }

        #endregion Constructors

        #region Properties

        public DateTime? DueDate
        {
            get;
            set;
        }

        public string Group
        {
            get;
            set;
        }

        public ColorScheme GroupColor
        {
            get;
            set;
        }

        public ColorScheme ProjectColor
        {
            get;
            set;
        }

        public string ProjectDescription
        {
            get;
            set;
        }

        public DateTime? StartDate
        {
            get;
            set;
        }

        public string TeamName
        {
            get;
            set;
        }

        public string Title
        {
            get;
            set;
        }

        public string ToolTip
        {
            get
            {
                if ( string.IsNullOrEmpty( _ToolTip ) )
                    _ToolTip = string.Format( "<b>{0}</b><br/><b>Team:</b> {3}<br/><b>Started:</b> {1}  <b>Due:</b> {2}<br/>{4}", Title, StartDate.HasValue ? StartDate.Value.ToString( MMMDYY ) : NA, DueDate.Value.ToString( MMMDYY ), TeamName, ProjectDescription );
                return _ToolTip;
            }
        }

        #endregion Properties
    }
}